import request from '@/utils/request'

// 发布评论
export const commentAdd = (comment) => {
  return request.post('/comment/add', comment, {
    headers: { 'Content-Type': 'application/json' }
  })
}

// 根据新闻id获取评论
export const commentGetAll = (id) => {
  return request.get('/comment/newsid?id=' + id)
}

// 管理员获取所有评论信息
export const getAllCommentByAdmin = () => {
  return request.get('/comment/all')
}

//删除评论
export const deleteCommentByAdmin = (commentId) => {
  return request.delete('/comment/delete?commentId='+commentId)
}